const mongoose = require('mongoose');

const itemSchema = new mongoose.Schema({
  itemName: {
    type: String,
    required: true
  },
  itemPrice: {
    type: Number,
    required: true
  },
  itemStore: {
    type: Number,
    default: 0
  },
  itemDesc: {
    type: String,
    default: ''
  },
  itemThumb: String,
  isSale: {
    type: String,
    default: '0' // 0上架 1下架
  },
  content: String
})

// 创建表
const itemModel = mongoose.model('qf_items', itemSchema);

module.exports = itemModel;